package com.aop.interceptor;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.springframework.beans.factory.config.BeanPostProcessor;

/**
 * @Author: tgy
 * @Date: 2020-08-06 11:16
 */
public class CustomMethodInterceptor implements MethodInterceptor {


    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {


        System.out.println(invocation.getMethod().getName() + "执行之前");
        Object proceed = invocation.proceed();
        System.out.println(invocation.getMethod().getName() + "执行之后");
        return proceed;
    }
}
